<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
<%@taglib uri="/WEB-INF/fn.tld" prefix="fn"%>
<%@taglib uri="/WEB-INF/el.tld" prefix="el"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<c:import url="/includes/css_inc.jsp"/>
		<c:import url="/includes/js_inc.jsp"/>
		<script>
			$(function(){
		        thaiDatepicker("date","#","1");
		        thaiDatepicker("trnDate","#","1");
		        thaiDatepicker("trnDateExport","#","1");
		        thaiDatepicker("dailyStatementEndDate","#","1");
		        thaiDatepicker("dailyStatementStartDate","#","1");
		        thaiDatepicker("exportDailyStatementEndDate","#","1");
		        thaiDatepicker("exportDailyStatementStartDate","#","1");
		        
		        $("#connect").button({
		            icons: {
		                primary: "ui-icon-search"
		            }
		        }).click(function(){
					if(validateEmptyById(["#FTPHost","#FTPUserId","#FTPPasswd"])){
					} else {
						return false;
					}
				});
		        $("#btnTranfer").button({
		            icons: {
		                primary: "ui-icon-circle-arrow-n"
		            }
		        }).click(function(){
					if(validateEmptyById(["$yyyy","$mm"])){
					} else {
						return false;
					}
				});
		        $("#btnCheque").button({
		            icons: {
		                primary: "ui-icon-circle-arrow-n"
		            }
		        }).click(function(){
					if(validateEmptyById(["#date"])){
						$("#importCheque").submit();
					} else {
						return false;
					}
				});
		        $("#btnDownload").button({
		            icons: {
		                primary: "ui-icon-circle-arrow-s"
		            }  
		        }).click(function(){
					if(validateEmptyById(["$provinceId","#trnDate","@bankType"])){
						$("#downloadFile").submit();
					} else {
						return false;
					}
				});
		        $("#btnExport").button({
		            icons: {
		                primary: "ui-icon-circle-arrow-s"
		            }  
		        }).click(function(){
					if(validateEmptyById(["$provinceIdEx","#listDocNo","#trnDateExport","@bankType"])){
						$("#exportFile").submit();
					} else {
						return false;
					}
				});
		        $("#btnEndProcessTransfer").button({
		            icons: {
		                primary: "ui-icon-disk"
		            }  
		        }).click(function(){
					if(validateEmptyById(["#docNo"])){
						$("#endProcessTransfer").submit();
					} else {
						return false;
					}
				});
		        $("#btnSetErrMsg").button({
		            icons: {
		                primary: "ui-icon-gear"
		            }
		        });
		        $("#btnUpdateStatus").button({
		            icons: {
		                primary: "ui-icon-disk"
		            }
		        }).click(function(){
					if(validateEmptyById(["$type","#listDocNo2"])){
						$("#updateStatus").submit();
					} else {
						return false;
					}
				});
		       $("#btnForward2Report").button({
		            icons: {
		                primary: "ui-icon-gear"
		            }
		        }).click(function(){
		        	$("#forward2Report").submit();
		        	/* window.open(
		        		'http://192.168.2.248:8080/BOE/OpenDocument/opendoc/openDocument.jsp?lsSname=testName&lsSsur_name=testSurName&token=${token}&sIDType=CUID&iDocID=AbuI3Tj24.5DimhPt8J.I98',
		        		'_blank' // <- This is what makes it open in a new window.
		        	); */
		        });
		       $("#btnImportDailyStatement").button({
		            icons: {
		                primary: "ui-icon-circle-arrow-n"
		            }
		        }).click(function(){
					if(validateEmptyById(["#dailyStatementStartDate","#dailyStatementEndDate"])){
						$("#importDailyStatement").submit();
					} else {
						return false;
					}
				});
		       $("#btnExportDailyStatement").button({
		            icons: {
		                primary: "ui-icon-circle-arrow-s"
		            }
		        }).click(function(){
					if(validateEmptyById(["#exportDailyStatementStartDate","#exportDailyStatementEndDate"])){
						$("#exportDailyStatement").submit();
					} else {
						return false;
					}
				});
		       
			});
		</script>
	</head>
	<body>
		<c:import url="/apps/msg.jsp"/>
		<form class="acc67-form" name="searchForm" id="searchForm" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="testConnectFTP"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2"><b>${screenCode.ACC670103}</b></th>
			</tr>
			<tr>
				<td width="20%" class="bold">FTP Host : </td>
				<td>
					<input type="text" name="FTPHost" id="FTPHost" value="${FTPHost}"/>
					<span id="#FTPHost" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td width="20%" class="bold">FTP UserId : </td>
				<td>
					<input type="text" name="FTPUserId" id="FTPUserId"  value="${FTPUserId}"/>
					<span id="#FTPUserId" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td width="20%" class="bold">FTP Passwd : </td>
				<td>
					<input type="password" name="FTPPasswd" id="FTPPasswd"  value="${FTPPasswd}"/>
					<span id="#FTPPasswd" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<button type="submit" name="connect" id="connect" class="acc67-button"> เชื่อมต่อ FTP </button>
				</td>
			</tr>
		</table>
		</form>
		<br/>
		<!-- form Transfer 1-->
		<form class="acc67-form" name="importTranfer" id="importTranfer" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="importTranfer"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2">นำเข้าข้อมูลการโอนจาก ธกส.</th>
			</tr>
			<tr>
				<td width="30%" class="bold">ปี : </td>
				<td>
					<select id="yyyy" name="yyyy">
						<option value="">----- เลือก -----</option>
						<c:forEach items="${lsBudgetYearAc}" var="data">
							<c:if test ="${yyyy == data.BUDGET_YEAR}" var="selected"/>
							<option value="${data.BUDGET_YEAR}" ${selected ? 'selected' : ''}>${data.BUDGET_YEAR}</option>
						</c:forEach>
					</select>
					<span id="$yyyy" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td class="bold">เดือน : </td>
				<td>
					<select id="mm" name="mm">
						<option value="">----- เลือก -----</option>
						<option value="01" ${mm == '01' ? 'selected' : ''}>มกราคม</option>
						<option value="02" ${mm == '02' ? 'selected' : ''}>กุมภาพันธ์</option>
						<option value="03" ${mm == '03' ? 'selected' : ''}>มีนาคม</option>
						<option value="04" ${mm == '04' ? 'selected' : ''}>เมษายน</option>
						<option value="05" ${mm == '05' ? 'selected' : ''}>พฤษภาคม</option>
						<option value="06" ${mm == '06' ? 'selected' : ''}>มิถุนายน</option>
						<option value="07" ${mm == '07' ? 'selected' : ''}>กรกฎาคม</option>
						<option value="08" ${mm == '08' ? 'selected' : ''}>สิงหาคม</option>
						<option value="09" ${mm == '09' ? 'selected' : ''}>กันยายน</option>
						<option value="10" ${mm == '10' ? 'selected' : ''}>ตุลาคม</option>
						<option value="11" ${mm == '11' ? 'selected' : ''}>พฤศจิกายน</option>
						<option value="12" ${mm == '12' ? 'selected' : ''}>ธันวาคม</option>
					</select>
					<span id="$mm" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td class="bold">นำเข้าข้อมูลการโอนจาก ธกส.</td>
				<td>
					<button type="submit" name="btnTranfer" id="btnTranfer" class="acc67-button"> นำเข้าข้อมูล </button>
				</td>
			</tr>
		</table>
		</form>
		<!-- end form Transfer 1 -->
		<br/>
		<!-- form Cheque 1-->
		<%-- <form class="acc67-form" name="importCheque" id="importCheque" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="importCheque"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2">นำเข้าข้อมูลเช็คจาก ธกส.</th>
			</tr>
			<tr>
				<td width="20%" class="bold">นำเข้าข้อมูลเช็คจาก ธกส. : </td>
				<td>
					<input type="text" name="date" id="date" size="12" maxlength="10" onkeypress="return numberAndSlash(event);" onblur="dateFormat(this);" value="${date}"/>
					<span id="#date" class="red">*</span>
				</td>
			</td>
			<tr>
				<td align="center" colspan="2">
					<button type="submit" name="btnCheque" id="btnCheque" class="acc67-button"> นำเข้าข้อมูล </button>
				</td>
			</tr>
		</table>
		</form> --%>
		<!-- end form Cheque 1 -->
		<br/>
		<!-- Download File -->
		<form class="acc67-form" name="downloadFile" id="downloadFile" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="downloadFile"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2">Download File</th>
			</tr>
			<tr>
				<td width="20%" class="bold">จังหวัด : </td>
				<td>
					<select name="provinceId" id="provinceId">
						<option value="">----- เลือก -----</option>
						<c:forEach var="data" items="${userInfo.listUserProvice}">
							<c:if test="${data.provinceId == provinceId}" var="provinceSeleted"/>
							<option value="${data.provinceId}" ${provinceSeleted?'selected':''}>${data.provinceName}</option>
						</c:forEach>
					</select>
					<span id="$provinceId" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td class="bold">วันที่ : </td>
				<td>
					<input type="text" name="trnDate" id="trnDate" size="12" maxlength="10" onkeypress="return numberAndSlash(event);" onblur="dateFormat(this);" value="${trnDate}"/>
					<span id="#trnDate" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input type="radio" name="bankType" id="bankTypeIn" ${bankType=='in'?'checked':''} value="in"/>ภายใน ธกส.
					<input type="radio" name="bankType" id="bankTypeOut" ${bankType=='out'?'checked':''} value="out"/>ต่างธนาคาร
					<span id="@bankType" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<button type="submit" name="btnDownload" id="btnDownload" class="acc67-button"> Download </button>
				</td>
			</tr>
		</table>
		</form>
		<!-- End Download File -->
		<br/>
		<!-- Export File -->
		<form class="acc67-form" name="exportFile" id="exportFile" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="exportFile"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="3">Export File</th>
			</tr>
			<tr>
				<td width="20%" class="bold">จังหวัด : </td>
				<td colspan="2">
					<select name="provinceIdEx" id="provinceIdEx">
						<option value="">----- เลือก -----</option>
						<c:forEach var="data" items="${userInfo.listUserProvice}">
							<c:if test="${data.provinceId == provinceId}" var="provinceSeleted"/>
							<option value="${data.provinceId}" ${provinceSeleted?'selected':''}>${data.provinceName}</option>
						</c:forEach>
					</select>
					<span id="$provinceIdEx" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td class="bold">วันที่ส่ง : </td>
				<td colspan="2">
					<input type="text" name="trnDateExport" id="trnDateExport" size="12" maxlength="10" onkeypress="return numberAndSlash(event);" onblur="dateFormat(this);" value="${trnDateExport}"/>
					<span id="#trnDateExport" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td class="bold" valign="top">List DocNo: </td>
				<td>
					<textarea name="listDocNo" id="listDocNo" cols="50" rows="5"></textarea>
				</td>
				<td valign="top">
					<span class="red">ตัวอย่างการใส่เลขที่เอกสาร 'ACC62556A6000000001','ACC62556A6000000002'</span>
					<span id="#listDocNo" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td></td>
				<td colspan="2">
					<input type="radio" name="bankType" id="bankTypeIn" ${bankType=='in'?'checked':''} value="in"/>ภายใน ธกส.
					<input type="radio" name="bankType" id="bankTypeOut" ${bankType=='out'?'checked':''} value="out"/>ต่างธนาคาร
					<span id="@bankType" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="3">
					<button type="submit" name="btnExport" id="btnExport" class="acc67-button"> Export </button>
				</td>
			</tr>
		</table>
		</form>
		<!-- End Export File -->
		<!-- endProcessTransfer -->
		<form class="acc67-form" name="endProcessTransfer" id="endProcessTransfer" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="endProcessTransfer"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2">End Process Transfer</th>
			</tr>
			<tr>
				<td class="bold" width="20%" valign="top">เลขที่เอกสาร : </td>
				<td>
					<input type="text" name="docNo" id="docNo" value="${docNo}"/>
					<span id="#docNo" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<button type="submit" name="btnEndProcessTransfer" id="btnEndProcessTransfer" class="acc67-button"> Submit </button>
				</td>
			</tr>
		</table>
		</form>
		<!-- endProcessTransfer -->
		<!-- setErrMsg -->
		<form class="acc67-form" name="setErrMsg" id="setErrMsg" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="setErrMsg"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2">Set Error Message [Y]</th>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<button type="submit" name="btnSetErrMsg" id="btnSetErrMsg" class="acc67-button"> Set </button>
				</td>
			</tr>
		</table>
		</form>
		<!-- end setErrMsg -->
		<!-- test pass2Report -->
		<%-- <form class="acc67-form" name="forward2Report" id="forward2Report" action="${pageContext.request.contextPath}/acc67" method="post" target="_blank">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="forward2Report"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2">passs2Report</th>
			</tr>
			<tr>
				<td class="bold">จังหวัด : </td>
				<td>
					<c:if test="${userInfo.areaLevel =='3'}">
						<c:forEach var="data" items="${userInfo.listUserProvice}">
							${data.provinceName}
							<input type="hidden" name="provinceId" id="provinceId" value="${data.provinceId}">
						</c:forEach>
					</c:if>
					<c:if test="${userInfo.areaLevel=='1' || userInfo.areaLevel=='2'}">
						<select name="provinceId" id="provinceId">
							<option value="">เลือกทั้งหมด</option>
							<c:forEach var="data" items="${userInfo.listUserProvice}">
								<c:if test="${data.provinceId == provinceId}" var="provinceSeleted"/>
								<option value="${data.provinceId}" ${provinceSeleted?'selected':''}>${data.provinceName}</option>
							</c:forEach>
						</select>
					</c:if>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<button type="button" name="btnForward2Report" id="btnForward2Report" class="acc67-button"> Test </button>
				</td>
			</tr>
		</table>
		</form> --%>
		<!-- end pass2Report -->
		<!-- Update Status -->
		<form class="acc67-form" name="updateStatus" id="updateStatus" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="updateStatus"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="3">Update Status</th>
			</tr>
			<!-- <tr>
				<td class="bold" valign="top" width="20%">การจ่าย : </td>
				<td colspan="2">
					<select name="type" id="type">
						<option value="">----- เลือก -----</option>
						<option value="T">จ่ายโอน</option>
						<option value="C">จ่ายเช็ค</option>
						<option value="LS">จ่ายเช็คหลายกองทุน</option>
					</select>
					<span id="$type" class="red">*</span>
				</td>
			</tr> -->
			<tr>
				<td class="bold" valign="top" width="20%">List DocNo : </td>
				<td>
					<textarea name="listDocNo2" id="listDocNo2" cols="50" rows="5"></textarea>
				</td>
				<td valign="top">
					<span class="red">ตัวอย่างการใส่เลขที่เอกสาร ACC62556A6000000001,ACC62556A6000000002</span>
					<span id="#listDocNo2" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td align="center" colspan="3">
					<button type="submit" name="btnUpdateStatus" id="btnUpdateStatus" class="acc67-button"> Update </button>
				</td>
			</tr>
		</table>
		</form>
		<!-- end Update Status -->
		<form class="acc67-form" name="importDailyStatement" id="importDailyStatement" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="importDailyStatement"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="3">นำเข้าข้อมูลรายการเดินบัญชีในสมุดธนาคาร</th>
			</tr>
			<tr>
				<td width="20%" class="bold">วันที่นำเข้าข้อมูล  : </td>
				<td>
					<input type="text" name="dailyStatementStartDate" id="dailyStatementStartDate" size="12" maxlength="10" onkeypress="return numberAndSlash(event);" onblur="dateFormat(this);" value="${dailyStatementStartDate}"/>
					<span id="#dailyStatementStartDate" class="red">*</span>&nbsp; ถึงวันที่ &nbsp;
					<input type="text" name="dailyStatementEndDate" id="dailyStatementEndDate" size="12" maxlength="10" onkeypress="return numberAndSlash(event);" onblur="dateFormat(this);" value="${dailyStatementEndDate}"/>
					<span id="#dailyStatementEndDate" class="red">*</span>
				</td>
			</td>
			<tr>
				<td align="center" colspan="3">
					<button type="submit" name="btnImportDailyStatement" id="btnImportDailyStatement" class="acc67-button"> Import </button>
				</td>
			</tr>
		</table>
		</form>
		<%-- <form class="acc67-form" name="exportDailyStatement" id="exportDailyStatement" action="${pageContext.request.contextPath}/acc67" method="post">
		<input type="hidden" name="app" id="app" value="ACC670103"/>
		<input type="hidden" name="job" id="job" value="exportDailyStatement"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="3">Export Daily Statement</th>
			</tr>
			<!-- <tr>
				<td width="20%" class="bold">บัญชี : </td>
				<td>
					<select name="accType" id="accType">
						<option value="">----- เลือก -----</option>
						<option value="6">บัญชี 6</option>
						<option value="7">บัญชี 7</option>
					</select>
					<span id="#accType" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td class="bold">ประเภทบัญชี : </td>
				<td>
					<select name="acccountType" id="acccountType">
						<option value="">----- เลือก ------</option>
						<option value="S">บัญชีออมทรัพย์</option>
						<option value="D">บัญชีกระแสรายวัน</option>
					</select>
					<span id="#acccountType" class="red">*</span>
				</td>
			</tr> -->
			<tr>
				<td class="bold">วันที่  : </td>
				<td>
					<input type="text" name="exportDailyStatementStartDate" id="exportDailyStatementStartDate" size="12" maxlength="10" onkeypress="return numberAndSlash(event);" onblur="dateFormat(this);" value="${dailyStatementStartDate}"/>
					<span id="#exportDailyStatementStartDate" class="red">*</span>&nbsp; ถึงวันที่ &nbsp;
					<input type="text" name="exportDailyStatementEndDate" id="exportDailyStatementEndDate" size="12" maxlength="10" onkeypress="return numberAndSlash(event);" onblur="dateFormat(this);" value="${dailyStatementEndDate}"/>
					<span id="#exportDailyStatementEndDate" class="red">*</span>
				</td>
			</td>
			<tr>
				<td align="center" colspan="3">
					<button type="submit" name="btnExportDailyStatement" id="btnExportDailyStatement" class="acc67-button"> Export </button>
				</td>
			</tr>
		</table>
		</form> --%>
	</body>
</html>